﻿namespace EFS.RC.CC.Tools.Loggers
{
	public static class CHL
	{
		/// <summary>
		/// Add Event
		/// </summary>
		/// <param name="conversationGuid"></param>
		/// <param name="customerUri"></param>
		/// <param name="agentADGuid"></param>
		/// <param name="supervisorADGuid"></param>
		/// <param name="hwPartyID"></param>
		/// <param name="hwApplicantID"></param>
		/// <param name="conversationClassID"></param>
		/// <param name="eventCode"></param>
		/// <returns></returns>
		public static System.DateTime Add(
			System.Guid conversationGuid,
			System.Int32? endPointID,
			System.String customerUri,
			System.Guid? agentADGuid,
			System.Guid? supervisorADGuid,
			System.Int64? hwPartyID,
			System.Int32? hwApplicantID,
			System.Int32? conversationClassID,
			EFS.RC.CC.Events.Conversation eventCode)
		{
			try
			{
				return (new EFS.RC.CC.CHL.Loggers.Messages.Conversation(conversationGuid, endPointID, customerUri, agentADGuid, supervisorADGuid, hwPartyID, hwApplicantID, conversationClassID, eventCode)).Occurred;
			}
			catch (System.Exception ex)
			{
 				// log
				EFS.EventLog.Log.LogException(ex, null);
			}

			// occurred
			return System.DateTime.Now;
		}

		/// <summary>
		/// Add Activity
		/// </summary>
		/// <param name="userADGuid"></param>
		/// <param name="activityCode"></param>
		/// <returns></returns>
		public static System.DateTime Add(
			System.Guid userADGuid,
			System.Int64 activityCode,
			System.String customActivityDescription)
		{
			try
			{
				return (new EFS.RC.CC.CHL.Loggers.Messages.UserActity(userADGuid, activityCode, customActivityDescription)).Occurred;
			}
			catch (System.Exception ex)
			{
				// log
				EFS.EventLog.Log.LogException(ex, null);
			}

			// occurred
			return System.DateTime.Now;
		}

		/// <summary>
		/// Add questionare answer
		/// </summary>
		/// <param name="userADGuid"></param>
		/// <param name="activityCode"></param>
		/// <returns></returns>
		public static System.DateTime Add(
			System.Guid conversationGuid,
			System.Int32 questionId,
			System.Int32 answreCode)
		{
			try
			{
				return (new EFS.RC.CC.CHL.Loggers.Messages.QuestionareSessionAnswer(conversationGuid, questionId, answreCode)).Occurred;
			}
			catch (System.Exception ex)
			{
				// log
				EFS.EventLog.Log.LogException(ex, null);
			}

			// occurred
			return System.DateTime.Now;
		}
	}
}
